#pragma once

#include "INetworkChannel.h"
#include "TcpChannel.h"
#include "KcpChannel.h"
#include <memory>
#include <asio.hpp>

namespace SeanNetwork {

/**
 * @brief Factory class for creating network channels.
 * 
 * Implements the Factory pattern to create appropriate channel types
 * based on requested channel type.
 */
class NetworkChannelFactory {
public:
    /**
     * Creates a network channel of the specified type.
     * 
     * @param type The type of channel to create
     * @param ioContext The asio::io_context to use for the channel
     * @return A unique_ptr to an INetworkChannel implementation
     */
    static std::unique_ptr<INetworkChannel> CreateChannel(
        ChannelType type, 
        asio::io_context& ioContext) {
        
        switch (type) {
            case ChannelType::TCP:
                return std::make_unique<TcpChannel>(ioContext);
            
            case ChannelType::KCP:
                return std::make_unique<KcpChannel>(ioContext);
            
            default:
                return nullptr;
        }
    }
};

} // namespace SeanNetwork 
